package com.boyunv.observer.example02;
/*
 *@description
 *
 *@author boyunv
 *@create 2023/8/12 15:20
 *@version 1.0
 */

import java.util.Date;

public class LotteryServiceImpl implements LotteryService
{

 //注入摇号服务
 private DrawHouseService houseService=new DrawHouseService();


 @Override
 public LotteryResult lottery(String uId) {
  //1.摇号
  String result = houseService.lots(uId);
  //2.发短信
  System.out.println("发送短信通知用户,ID为:"+uId+",您的摇号结果如下"+result);
  //3.发送MQ信息
  System.out.println("记录用户摇号结果到MQ,ID为:"+uId+",您的摇号结果如下"+result);


  return new LotteryResult(uId,result,new Date());
 }
}
